﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-Type" content="text/html; charset=utf-8" />
<meta name="Author" content="jumbot.cn">
<meta name="Keywords" content="英汉,军事,专业词汇,查询,系统">
<meta name="Description" content="英汉军事专业词汇查询系统">
<title>英汉军事专业词汇查询系统</title>
<link href="{site.Dir}extends/translate/styles/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="{site.Dir}_data/SysConfig.js"></script>
<script type="text/javascript" src="{site.Dir}_libs/jquery-min.js"></script>
<script type="text/javascript" src="{site.Dir}scripts/jumbotcms.js?v4"></script>
<script type="text/javascript" src="{site.Dir}scripts/front.js?4"></script>
<link type="text/css" rel="stylesheet" href="{site.Dir}style/global.css" />
<script type="text/javascript">
var type = q("type") == "2" ? "2" : "1";
var k = unescape(q("k"));
(function(){
	$(document).ready(function() {
		$("input[@name=type][@value="+type+"]").attr("checked",true);
		$("#word").val(k);
		sendRequest(1);
	});
})();
function sendRequest(p){
	if($("#word").val()==""){
		$("#result").html("<img src=\"styles/icon2.gif\" /> 请输入需要翻译的句子的关键字。");
		return;
	}
	if($("#word").val().length<2){
		$("#result").html("<img src=\"styles/icon2.gif\" /> 请输入2个以上字符。");
		return;
	}
	var typeNum = $("input[@name=type][@type=radio][@checked]").val();
	$.ajax({
		url:        "getxml.aspx?oper=getdata&q="+escape($("#word").val())+"&p="+p+"&type="+typeNum+"&time="+(new Date().getTime()),
		type:       "get",
		dataType:   "xml",
		timeout:    3000,
		error:function(xml){
			$("#result").html("查询失败，请稍后重试...");
		},
		success:    function(xml){
			if($(xml).find("logined").text()=="1")
			{
				var html;
				//html="<span class=\"word\">"+$("#word").val()+"</span>";
				//html+="　<span class=\"pronounce\">"+$(xml).find("pron").text()+"</span>";
				html="";
				$(xml).find('def').each(function(){
					html+=" <span class=\"def\">"+$(this).text()+"</span>";
				});
				$(xml).find('sent').each(function(i){
					html+="<span class=\"orig\">"+$(this).children("orig").text()+"</span>";
					html+="<span class=\"trans\">"+$(this).children("trans").text()+"</span>";
				});
				$(xml).find('pagebar').each(function(){
					html+="<div class=\"link\">"+$(this).text()+"</div>";
				});
				$("#result").html(html);
			}
		},
		start:function(xml){
			$("#result").html("正在查询中，请稍后...");
		}
	});
}
</script>
</head>
<body>
<div id="wrapper">
	<div id="topic"><img src="styles/toplogo.jpg" border="0" /></div>
	<div class="search">
			<div class="search_input_box">
				<input type="radio" name="type" value="1" checked />
				英译中
				<input type="radio" name="type" value="2" />
				中译英<br />
				<input type="text" id="word" value="" class="search_input" />
				<br />
				<input class="search_input_submit" type="button" value="" onclick="sendRequest(1);">
			</div>
	</div>
	<div class="result">
		<span id="result" class="hint"> <img src="styles/icon2.gif" /> 请输入需要翻译的句子的关键字。</span>
	</div>
        <div class="bottom">{site.Name}&nbsp;&copy;&nbsp;2009&nbsp;版权所有</div>
</div>
</body>
</html>
